[Unit]
Description=Docker Application Container Engine
Documentation=http://docs.docker.com
After=docker.socket network.target
Requires=docker.socket

[Service]
Type=notify
Environment="DOCKER_OPT_BIP=--bip={{ bip.stdout }}"
Environment="DOCKER_OPT_MTU=--mtu={{ mtu.stdout }}"
Environment="DOCKER_OPT_DNS=--dns={{ node_ip }}"
Environment="DOCKER_OPT_DNS_SEARCH=--dns-search={{ domain }}"

ExecStart=/usr/bin/dockerd -H fd:// \
  $DOCKER_OPTS $DOCKER_OPT_BIP $DOCKER_OPT_MTU \
  $DOCKER_OPT_DNS $DOCKER_OPT_DNS_SEARCH

ExecReload=/bin/kill -s HUP $MAINPID

LimitNOFILE=1048576
LimitNPROC=infinity
LimitCORE=infinity
TasksMax=infinity
TimeoutStartSec=0
Delegate=yes

[Install]
WantedBy=multi-user.target